package com.ruoyi.project.dict.eryacatalog.service.impl;

import com.ruoyi.common.utils.text.Convert;
import com.ruoyi.framework.aspectj.lang.annotation.DataSource;
import com.ruoyi.framework.aspectj.lang.enums.DataSourceType;
import com.ruoyi.project.dict.eryacatalog.domain.EryaCatalog;
import com.ruoyi.project.dict.eryacatalog.mapper.EryaCatalogMapper;
import com.ruoyi.project.dict.eryacatalog.service.IEryaCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 尔雅目录Service业务层处理
 *
 * @author shixiangwen
 * @date 2021-08-19
 */
@Service
@DataSource(DataSourceType.DICT)
public class EryaCatalogServiceImpl implements IEryaCatalogService {
    @Autowired
    private EryaCatalogMapper eryaCatalogMapper;

    /**
     * 查询尔雅目录
     *
     * @param id 尔雅目录ID
     * @return 尔雅目录
     */
    @Override
    public EryaCatalog selectEryaCatalogById(Long id) {
        return eryaCatalogMapper.selectEryaCatalogById(id);
    }

    /**
     * 查询尔雅目录列表
     *
     * @param eryaCatalog 尔雅目录
     * @return 尔雅目录
     */
    @Override
    public List<EryaCatalog> selectEryaCatalogList(EryaCatalog eryaCatalog) {
        return eryaCatalogMapper.selectEryaCatalogList(eryaCatalog);
    }

    /**
     * 新增尔雅目录
     *
     * @param eryaCatalog 尔雅目录
     * @return 结果
     */
    @Override
    public int insertEryaCatalog(EryaCatalog eryaCatalog) {
        return eryaCatalogMapper.insertEryaCatalog(eryaCatalog);
    }

    /**
     * 修改尔雅目录
     *
     * @param eryaCatalog 尔雅目录
     * @return 结果
     */
    @Override
    public int updateEryaCatalog(EryaCatalog eryaCatalog) {
        return eryaCatalogMapper.updateEryaCatalog(eryaCatalog);
    }

    /**
     * 删除尔雅目录对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEryaCatalogByIds(String ids) {
        return eryaCatalogMapper.deleteEryaCatalogByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除尔雅目录信息
     *
     * @param id 尔雅目录ID
     * @return 结果
     */
    @Override
    public int deleteEryaCatalogById(Long id) {
        return eryaCatalogMapper.deleteEryaCatalogById(id);
    }
}
